//
//  XLConversationInputMoreItemCell.m
//  XLConversationInputView
//
//  Created by ilongge on 2022/8/5.
//

#import "XLCvstInputMoreItemCell.h"
#import "XLCIViewResourcesManager.h"
#import "XLConversationInputViewDef.h" 
#import "XLCvstInputMoreItemModel.h"

@interface XLCvstInputMoreItemCell()
@property (nonatomic, strong) UIImageView *imageIcon;
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation XLCvstInputMoreItemCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubviews];
    }
    return self;
}

- (void)initSubviews {
    self.imageIcon = [[UIImageView alloc] init];
    [self addSubview:self.imageIcon];
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    self.titleLabel.font = [UIFont fontWithName:kXLCIPingFangSC_Regular size:11];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLabel];
}

- (void)configMoreItemCellWith:(XLCvstInputMoreItemModel *)itemModel {
    self.imageIcon.image = itemModel.iconImage;
    self.titleLabel.text = itemModel.titleText;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    CGFloat width = self.frame.size.width;
    self.imageIcon.frame = CGRectMake((width - 52) / 2.0, 0, 52, 52);
    self.titleLabel.frame = CGRectMake(0, 60, width, 14);
}
@end
